<div class="students index">
<h2><?php __('Список студентов');?></h2>
<p>
<?php
//debug ($professions);
//debug ($courses);
//debug ($students);
echo $paginator->counter(array(
'format' => __('Страница %page% из %pages%, показано %current% записей из %count% всего, начиная с %start%, заканчивая %end%', true)
));
?></p>
<table cellpadding="0" cellspacing="0" class="art-article">
<tr>
	<th><?php echo $paginator->sort('id');?></th>
	<th><?php echo $paginator->sort('Фамилия', 'lastname');?></th>
	<th><?php echo $paginator->sort('Имя', 'firstname');?></th>
	<th><?php echo $paginator->sort('Отчество', 'surname');?></th>	
	<th>Факультет</th>
	<th>Специальность</th>
	<th>Курс</th>
	<th><?php echo $paginator->sort('группа', 'studentgroup_id');?></th>	
	<th><?php echo $paginator->sort('Форма обуч.', 'learningform_id');?></th>
	<th><?php echo $paginator->sort('Тип обуч.', 'learningtype_id');?></th>
	<th><?php echo $paginator->sort('Состояние', 'studentstate_id');?></th>
	<!--<th><?php echo $paginator->sort('Ун. Номер', 'unic_number');?></th>
	-->

	<th class="actions"><?php __('Действия');?></th>

</tr>
<?php
$i = 0;
foreach ($students as $student):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $student['Student']['id']; ?>
		</td>
		<td>
			<?php echo $student['Student']['lastname']; ?>
		</td>
		<td>
			<?php echo $student['Student']['firstname']; ?>
		</td>
		<td>
			<?php echo $student['Student']['surname']; ?>
		</td>		
		<td>
			<?php echo $facultets[$courses[$student['Studentgroup']['course_id']-1]['Profession']['facultet_id']]; ?>
		</td>
		<td>
			<?php echo $courses[$student['Studentgroup']['course_id']-1]['Profession']['name']; ?>
		</td>
		<td>
			<?php echo $courses[$student['Studentgroup']['course_id']-1]['Course']['name']; ?>
		</td>
		<td>
			<?php echo $student['Studentgroup']['name']; ?>
		</td>				
		<td>
			<?php echo $learningforms[$student['Student']['learningform_id']]; ?>
		</td>
		<td>
			<?php echo $learningtypes[$student['Student']['learningtype_id']]; ?>
		</td>

		<td>
			<?php echo $student['Studentstate']['name']; ?>
		</td>

		<!--
		<td>
			<?php echo $student['Student']['unic_number']; ?>
		</td>
		-->
		<td class="actions">
			<?php // echo $html->link(__('View', true), array('controller' => 'studentinfos', 'action' => 'showinfo', $student['Student']['id'])); ?>
			<?php // echo $html->link(__('View', true), array('action' => 'view', $student['Student']['id'])); ?>
			<?php  echo $html->link(__('Подробнее', true), array('controller' => 'studentinfos', 'action' => 'showinfo', $student['Student']['id'])); ?>			
			<?php //  echo $html->link(__('Изменить', true), array('action' => 'edit', $student['Student']['id'])); ?>
			<?php // echo $html->link(__('Delete', true), array('action' => 'delete', $student['Student']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $student['Student']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
	<?php echo $paginator->prev('<< '.__('назад', true), array(), null, array('class'=>'disabled'));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next(__('вперед', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>